//
//  CLComposeMenuButton.swift
//  CLWeibo
//
//  Created by 陈亮 on 16/7/16.
//  Copyright © 2016年 陈亮. All rights reserved.
//

import UIKit

class CLComposeMenuButton: UIButton {

    //设置模型
    var composeMenu:CLComposeMenu?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
     
        setUpUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    private func setUpUI() {
        titleLabel?.font = UIFont.systemFontOfSize(15)
        setTitleColor(UIColor.orangeColor(), forState: .Normal)
        titleLabel?.textAlignment = .Center
    }
    //重写Highlighted属性
    override var highlighted:Bool {
        get {
            return false
        }set {
            
        }
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        //设置子控件的狂傲
        imageView?.width = width
        imageView?.y = 0
        imageView?.height = width
        
        titleLabel?.x = 0
        titleLabel?.y = width
        titleLabel?.width = width
        titleLabel?.height = height - width
        
    }
}
